package homework.szzs;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

public class FirstActivity extends AppCompatActivity {

    private LinearLayout information_LinearLayout;

    private TextView allInformation_TextView;
    private TextView detail_TextView;

    private Button addNewItem_Button;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_first);

        addNewItem_Button=(Button)findViewById(R.id.addNewItem_button);
        detail_TextView=(TextView)findViewById(R.id.detail_TextView);
        allInformation_TextView=(TextView)findViewById(R.id.allInformation_TextView);
        information_LinearLayout=(LinearLayout)findViewById(R.id.information_linearLayouy);

        addNewItem_Button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                TextView b=new TextView(FirstActivity.this);
                b.setText("GG");
                information_LinearLayout.addView(b);
            }





        });

        detail_TextView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {


            }
        });

        allInformation_TextView.setOnClickListener(new View.OnClickListener() {
           @Override
           public void onClick(View v) {
               Intent i=new Intent();
               i.setClass(FirstActivity.this,PassActivity.class);
               startActivity(i);

           }
           }
        );


    }
}
